// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless;

public sealed partial class TopRightBottomLeftGeoBounds
{
	[JsonInclude, JsonPropertyName("bottom_left")]
	public Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomLeft { get; set; }
	[JsonInclude, JsonPropertyName("top_right")]
	public Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopRight { get; set; }
}

public sealed partial class TopRightBottomLeftGeoBoundsDescriptor : SerializableDescriptor<TopRightBottomLeftGeoBoundsDescriptor>
{
	internal TopRightBottomLeftGeoBoundsDescriptor(Action<TopRightBottomLeftGeoBoundsDescriptor> configure) => configure.Invoke(this);

	public TopRightBottomLeftGeoBoundsDescriptor() : base()
	{
	}

	private Elastic.Clients.Elasticsearch.Serverless.GeoLocation BottomLeftValue { get; set; }
	private Elastic.Clients.Elasticsearch.Serverless.GeoLocation TopRightValue { get; set; }

	public TopRightBottomLeftGeoBoundsDescriptor BottomLeft(Elastic.Clients.Elasticsearch.Serverless.GeoLocation bottomLeft)
	{
		BottomLeftValue = bottomLeft;
		return Self;
	}

	public TopRightBottomLeftGeoBoundsDescriptor TopRight(Elastic.Clients.Elasticsearch.Serverless.GeoLocation topRight)
	{
		TopRightValue = topRight;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		writer.WritePropertyName("bottom_left");
		JsonSerializer.Serialize(writer, BottomLeftValue, options);
		writer.WritePropertyName("top_right");
		JsonSerializer.Serialize(writer, TopRightValue, options);
		writer.WriteEndObject();
	}
}